package cn.outsourcing.supermarket.converter;

import cn.outsourcing.supermarket.converter.transform.BooleanToIntegerTransform;
import cn.outsourcing.supermarket.po.HiolabsGoodsSpecification;
import cn.outsourcing.supermarket.vo.hiolabs.HiolabsGoodsSpecificationVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 商品详情规格转换器
 *
 * @author gzkemays
 * @since 2021/10/22 15:37
 */
@Mapper(uses = {BooleanToIntegerTransform.class})
public interface HiolabsGoodsSpecificationConverter {
  HiolabsGoodsSpecificationConverter INSTANCE =
      Mappers.getMapper(HiolabsGoodsSpecificationConverter.class);

  /**
   * 转化为自身值对象
   *
   * @param specification 原 po 对象
   * @return 自身值对象
   */
  HiolabsGoodsSpecificationVO convertToVo(HiolabsGoodsSpecification specification);
  /**
   * 转化为自身列表值对象
   *
   * @param specification 原 po 列表对象
   * @return 自身值对象
   */
  List<HiolabsGoodsSpecificationVO> convertToVoList(List<HiolabsGoodsSpecification> specification);
}
